package com.maiji.cloud.controller;

import com.maiji.cloud.request.BaseInputDto;
import com.maiji.cloud.request.IdInputDto;
import com.maiji.cloud.request.community.ComUserMessageQueryInputDto;
import com.maiji.cloud.response.BaseOutPutDto;
import com.maiji.cloud.response.community.ComUserMessageOutputDto;
import com.maiji.cloud.response.community.ComUserMsgCountOutPutDto;
import com.maiji.cloud.response.login.UserInfoResData;
import com.maiji.cloud.service.ComUserMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/comMessage")
@Api(value = "社区消息模块")
public class ComUserMessageController {

    @Autowired
    ComUserMessageService comUserMessageService;

    @PostMapping("/messageCount")
    @ApiOperation("社区消息数量")
    public BaseOutPutDto<ComUserMsgCountOutPutDto> messageCount(@RequestBody BaseInputDto inputDto, @RequestHeader("maijiToken")String maijiToken){
        return comUserMessageService.messageCount(inputDto,maijiToken);
    }

    /**
     * 社区消息通用列表查询接口
     * @param inputDto
     * @param maijiToken
     * @return
     */
    @PostMapping("/comCommonMessages")
    @ApiOperation("社区消息通用列表查询接口")
    public BaseOutPutDto<List<ComUserMessageOutputDto>> comCommonMessages(@RequestBody BaseInputDto<ComUserMessageQueryInputDto> inputDto, @RequestHeader("maijiToken")String maijiToken){
        return comUserMessageService.comCommonMessages(inputDto,maijiToken);
    }


    /**
     * 评论相关消息
     * @param inputDto
     * @param maijiToken
     * @return
     */
    @PostMapping("/commentMessages")
    @ApiOperation("评论相关消息")
    public BaseOutPutDto<List<ComUserMessageOutputDto>> commentMessages(@RequestBody BaseInputDto inputDto, @RequestHeader("maijiToken")String maijiToken){
        return comUserMessageService.commentMessages(inputDto,maijiToken);
    }



    /**
     * 回复消息
     * @param inputDto
     * @param maijiToken
     * @return
     */
    @PostMapping("/replyMessages")
    @ApiOperation("回复消息")
    public BaseOutPutDto<List<ComUserMessageOutputDto>> replyMessages(@RequestBody BaseInputDto inputDto, @RequestHeader("maijiToken")String maijiToken){
        return comUserMessageService.replyMessages(inputDto,maijiToken);
    }

    /**
     * 点赞消息
     * @param inputDto
     * @param maijiToken
     * @return
     */
    @PostMapping("/praiseMessages")
    @ApiOperation("点赞消息")
    public BaseOutPutDto<List<ComUserMessageOutputDto>> praiseMessages(@RequestBody BaseInputDto inputDto, @RequestHeader("maijiToken")String maijiToken){
        return comUserMessageService.praiseMessages(inputDto,maijiToken);
    }

    /**
     * 被关注消息
     * @param inputDto
     * @param maijiToken
     * @return
     */
    @PostMapping("/followMessages")
    @ApiOperation("被关注消息")
    public BaseOutPutDto<List<ComUserMessageOutputDto>> followMessages(@RequestBody BaseInputDto inputDto, @RequestHeader("maijiToken")String maijiToken){
        return comUserMessageService.followMessages(inputDto,maijiToken);
    }

    /**
     * 被@消息
     * @param inputDto
     * @param maijiToken
     * @return
     */
    @PostMapping("/atMessages")
    @ApiOperation("被@消息")
    public BaseOutPutDto<List<ComUserMessageOutputDto>> atMessages(@RequestBody BaseInputDto inputDto, @RequestHeader("maijiToken")String maijiToken){
        return comUserMessageService.atMessages(inputDto,maijiToken);
    }

}
